package LeetCode热题HOT100;

public class p171Excel表列序号 {
    public int titleToNumber(String columnTitle) {
        int res=0;
        for (int i = 0; i <columnTitle.length(); i++) {
            int num=columnTitle.charAt(i)-'A'+1;//表示当前索引下 字符的值
            res=res*26+num;
        }
        return res;

    }
}
